-record(vendor_rec,{
		id = "",	%%uuid
		owner_id = "",	%% who own the vendor
		short_name = "",
		name = "", %%short desc
		desc = "",
		addr = "",
		city = "",
		contactor = "",
		mobile_phone = "",
		fix_phone = "",
		register_id = "",
		tag = ""
%% for future use
		}).
-record(vendor_cfg,{
		id,
		out_notify,	%% none, sms, weibo or other
		in_notify,	%%
		pre_out_notify,
		pre_out_notify_cond
		}).

-record(queue_rec,{
	id,
	vendor_id,
	name,
	icon_type,
	prefix,
	active,
	notify_cond,
	desc
}).

-record(user_rec,{
	id,
	register_id,
	login_name,
	password,
	name,
	right = operator,	%%tags
	phone,	%%tags
	mail,
	state = first_login,
	im}).

-record(v_register_rec,
	{
		id,
		mobile,
		status,
		company,
		addr,
		created_date,
		city,
		password,
		name,
		other
		}).

-record(user_vendor_rec,
	{v_id,
	u_id,
	created_date}
).
-record(login_rec,{
	id,
	user_id,
	login_name,
	register_id,
	password,
	right,
	state,
	vendor_id,
	vendor_name,
	history = [],
	mode,
	login_date,
	login_time,
	login_ip,
	logout_date,
	logout_time,
	logout_type,
	terminal
}).
-record(queue_inst_rec,{
		id,
		vendor_id,
		name,
        pid,
		notify_cond,
		prefix,
        servered_num,
        in_q_num = 0,
		cur_index,
        beg_time,
		end_time,
		cfg
		}
	).

-record(biz_unit_rec,{ %% business unit, for example, a store, may be a branch of big company
			name,
			addr,
			tele_mobile,
			tele_pstn,
			email	 
			}
	  	).

-record(queue_node_rec,{ %% one in q rec, node in queue
			name,
			queue_inst_name,
			tele_mobile,
			no,
			beg_time,
			end_time,
			status
			}
	   ).

-record(cust_in_q_rec,{
			id,
			cust_id,
            name,
            mobile,
            index,
            loc,
            state,
            in_q_time,
            last_sms_sent_time,
            sms_sent_times,
            out_q_time,
			q_id,
			vendor_id,
			q_name
        }).
-record(sms_snd_rec,{
	id,
	vendor_id,
	sent_time,
	content,
	event,
	event_id,	%% the event mean a queue event, or sth
	mobile,
	cust_id
}).
-record(cust_info,
		{id,
		name,
		mobile,
		addr}).

